home *** CD-ROM | disk | FTP | other *** search
- Path: news1.cle.ab.com!usenet
- From: don.phillips@ab.com (Donald-Anthony C. Phillips)
- Newsgroups: comp.lang.c
- Subject: Re: Best way to store in program messages?
- Date: Tue, 20 Feb 1996 17:48:56 GMT
- Organization: The Allen-Bradley Co., Inc
- Distribution: inet
- Message-ID: <4gcn0j$p0g@news1.cle.ab.com>
- References: <4gckb4$77e@news.mistral.co.uk>
- NNTP-Posting-Host: abpc386.cle.ab.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- One method would be to keep a text file of messages and message codes,
- where the message code would be the index. You could then create a
- function which extracted the message text based on the code:
-
- Text File:
-
- 0001Message number 1
- 0002Message number 2
- 0003Message number 3
-
- Char *GetMessage(char *messageindex)
- { open file
- find message based on messageindex
- if not found return NULL
- return(message)
-
- }
- Of course this is p-code, but hopefully you get the jist. Once you
- get into indexing, there exist many options for handling the index
- search and extraction.
-
- Hope this helps!!
-
- Donald-Anthony C. Phillips
- Programmer/Analyst
- Rockwell Automation
- ---------------------------------------
- Allen-Bradley
- don.phillips@ab.com
-
-